package com.ruoyi.web.controller.system;

import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.system.domain.ActivityCollectUser;
import com.ruoyi.system.domain.MeetingCollectUser;
import com.ruoyi.system.service.IActivityCollectUserService;
import com.ruoyi.system.service.IMeetingCollectUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 活动收集人员Controller
 *
 * @author ruoyi
 * @date 2024-04-04
 */
@RestController
@RequestMapping("/system/activity/collect/user")
public class ActivityCollectUserController extends BaseController
{
    @Autowired
    private IActivityCollectUserService activityCollectUserService;

    /**
     * 查询活动收集人员列表
     */
    @PreAuthorize("@ss.hasPermi('system:user:list')")
    @PostMapping("/list")
    public TableDataInfo list(@RequestBody ActivityCollectUser activityCollectUser)
    {
        List<ActivityCollectUser> list = activityCollectUserService.selectActivityCollectUserList(activityCollectUser);
        return getDataTable(list);
    }
//
//
//    /**
//     * 获取活动收集人员详细信息
//     */
//    @PreAuthorize("@ss.hasPermi('system:user:query')")
//    @GetMapping(value = "/{id}")
//    public AjaxResult getInfo(@PathVariable("id") Long id)
//    {
//        return success(meetingCollectUserService.selectMeetingCollectUserById(id));
//    }

//    /**
//     * 新增活动收集人员
//     */
//    @PreAuthorize("@ss.hasPermi('system:user:add')")
//    @Log(title = "活动收集人员", businessType = BusinessType.INSERT)
//    @PostMapping
//    public AjaxResult add(@RequestBody MeetingCollectUser meetingCollectUser)
//    {
//        return toAjax(meetingCollectUserService.insertMeetingCollectUser(meetingCollectUser));
//    }

    /**
     * 上传收集资料
     */
    @PreAuthorize("@ss.hasPermi('system:user:edit')")
    @Log(title = "活动收集人员状态", businessType = BusinessType.UPDATE)
    @PutMapping("/edit")
    public AjaxResult edit(@RequestBody ActivityCollectUser activityCollectUser)
    {
        return toAjax(activityCollectUserService.updateActivityCollectUser(activityCollectUser));
    }

//    /**
//     * 删除活动收集人员
//     */
//    @PreAuthorize("@ss.hasPermi('system:user:remove')")
//    @Log(title = "活动收集人员", businessType = BusinessType.DELETE)
//	@DeleteMapping("/{id}")
//    public AjaxResult remove(@PathVariable Long id)
//    {
//        return toAjax(meetingCollectUserService.deleteMeetingCollectUserById(id));
//    }
}
